<?php

use Biz\service\SamsungActivity\SamsungJoinUserListService;

class ListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    /**
     * @throws \Exception
     */
    public function main()
    {
        $currUid = $this->uid;
        $artistId = trim($this->getRequest()->getPost('artist_id', 0));//艺术家id

        if ($currUid > 0) {
            $uid = $currUid;
        } else {
            $uid = SamsungJoinUserListService::getSecretId();
        }
        $list = [];
        if ($artistId > 0) {
            $list = SamsungJoinUserListService::getList($uid, $artistId) ?? [];
        }

        $this->setSuccess(['list' => $list, 'secret_id' => $uid], self::API_CODE_SUCCES);

    }
}